/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 sequence_loader.h

	$Header: /heroes4/sequence_loader.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SEQUENCE_LOADER_H_INCLUDED )
#define SEQUENCE_LOADER_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <list>
#include "actor_sequence_ptr.h"
#include "data_lock.h"
#include "signal.h"
#include "thread.h"

// ------------------------------------------------------------------------
// thread which attempts to pre-load all of a set of combat actor sequences
// ------------------------------------------------------------------------
class t_sequence_loader : public t_thread
{
public:
	virtual ~t_sequence_loader();

	void add( t_actor_sequence_cache const& cache );
	void clear();

	virtual t_uint32 run();
protected:
	t_data_lock						  m_cache_lock;
	std::list<t_actor_sequence_cache> m_caches;
	t_signal                          m_data_available;
	t_data_lock                       m_pointer_lock;
	std::list<t_actor_sequence_ptr>   m_pointers;
};

#endif // SEQUENCE_LOADER_H_INCLUDED